/*
 * File:   F01.h
 * Author: jcrada
 *
 * Created on 27 May 2011, 3:00 PM
 */

#ifndef ECB_CEC10_F01_H
#define	ECB_CEC10_F01_H

#include "ecb/benchmarks/cec10/CecProblem.h" 

#include "ecb/benchmarks/cec10/CecMath.h"
#include "ecb/operator/Shifted.h"
#include "ecb/function/Elliptic.h"
#include "ecb/base/Math.h"

namespace ecb {
    namespace cec10 {

        class F01 : public CecProblem {
        private:
            Function* elliptic;
        public:

            F01(int dimensions)
            : CecProblem("F01", "Shifted Elliptic Function", dimensions,
            -100, 100, true, 0, new CecRandom(1l)) {
                std::vector<scalar> shift = CecMath::ShiftVector(dimensions, _properties->getMinimum(), _properties->getMaximum(), randomizer());
                elliptic = new Shifted(shift, 0, new Elliptic());
            }

            ~F01() {
                delete elliptic;
            }

            scalar f(const std::vector<scalar>& x){
                return elliptic->f(x);
            }
        };
    }
}

#endif	/* ECB_CEC10_F01_H */

